<div ng-include src="'tpl/public/header.html'"></div>
<div class="contents">
    <ol class="breadcrumb">
        <li>
            <a href="#/index/panel">首页</a>
        </li>
        <li class="active">
            竞价
            <span ng-if="config.pType=='02'">信托</span>
            <span ng-if="config.pType=='03'">资管</span>
            <span ng-if="config.pType=='06'">PE/VC</span>
            <span ng-if="config.pType=='05'">私募</span>
        </li>
    </ol>
    <form class="form-inline search-box" name="form" role="form" ng-submit="search()" novalidate>
        <div class="form-group">
            <label class="sr-only" >产品名称</label>
            <input type="text" class="form-control" placeholder="产品名称" ng-model="searchMap.pName"></div>
        <div class="form-group">
            <label class="sr-only">竞价人</label>
            <input type="text" style="width:130px;" class="form-control" placeholder="竞价人" ng-model="searchMap.uName"></div>
        <div class="form-group">
            <label class="sr-only">竞价人手机</label>
            <input type="text" style="width:140px;" class="form-control" placeholder="竞价人手机" ng-model="searchMap.uMobile"></div>
        <div class="form-group" ng-class="{'has-error':form.scDate.$invalid}">
            <label>竞价时间：</label>
            <input type="date" class="form-control" name="biddingDate" placeholder="竞价时间"
       ng-model="searchMap.startBiddingDate"  ng-pattern="/^\d{4}-\d{2}-\d{2}$/" maxlength="10"></div>
        <div class="form-group">
            <select class="form-control" placeholder="竞价状态" ng-model="searchMap.biddingStatus" ng-options="m.value as m.text for m in dictMap.biddingStatusModel" >
                <option value="">--选择竞价状态--</option>
            </select>
        </div>
        <div class="form-group">
            <select class="form-control" placeholder="销售状态" ng-model="searchMap.pSaleStatus" ng-options="m.value as m.text for m in dictMap.productSaleStatusModel" >
                <option value="">--选择销售状态--</option>
            </select>
        </div>
        <button type="submit" class="btn btn-primary">查询</button>
    </form>
    <div></div>
    <table class="table table-striped table-hover">
        <thead>
            <tr>
                <th width="30">
                    <input type="checkbox" name="chkProjectAll" id="chkProjectAll" ng-click="chkProjectAll();" />
                </th>
                <th width="50" ng-click="orderby('id')" class="cur-p">ID</th>
                <th width="150">产品名称</th>
                <th width="80">承销状态</th>
                <th width="150">竞价报价</th>
                <th width="50">竞价人</th>
                <th width="80">竞价人手机</th>
                <th width="110">抵押金</th>
                <th width="150" ng-click="orderby('createDate')">竞价时间<i class="orderby-icons" ng-class="{'orderby-asc':orderbyFreqMap['createDate'][orderbyPositionMap['createDate']] == 'asc','orderby-desc':orderbyFreqMap['createDate'][orderbyPositionMap['createDate']] == 'desc'}"></i></th>
                <th width="80">销售状态</th>
                <!-- <th width="80">产品资料</th> -->
                <th width="80">产品状态</th>
                <th width="180">操作</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="product in list">
                <td>
                    <input ng-if="product.checkStatus=4" type="checkbox" name="chkProject" accessId="{{product.id}}" value="{{product.id}}" />&nbsp;
                </td>
                <td>{{product.biddingCode}}</td>
                <td>
                    <a href="#/product/edit?id={{product.pId}}&t={{config.pType}}">{{product.pName}}</a>
                </td>
                <td>{{product.biddingStatus | biddingStatusModelRenter}}</td>
                <td>
                    <table>
                        <tr ng-repeat="a in product.fpBiddingRevenuVO">
                            <td>
                                {{a.pStartAmount/10000}}万 -  {{a.pEndAmount/10000}}万   {{a.rebateProfit|ratefilter}}
                            </td>
                        </tr>
                    </table>
                </td>
                <td>{{product.uName}}</td>
                <td>{{product.uMobile}}</td>
                <td>{{product.bailAmount|bailAmountRender}}({{product.operateType|operateTypeModelRenter}})</td>
                <td>{{product.biddingDate}}</td>
                <td>
                    <span>{{product.pSaleStatus | productSaleStatusRender }}</span>
                </td>
<!--                 <td>
                    <a href="{{staticHost}}{{product.productAttr}}" ng-show="product.productAttr">资料下载</a>
                </td> -->
                <td>{{product.pPublicStatus | productPublicStatusRender}}</td>
                <td class="optd">
                    <a href="#/bidproduct/detail?id={{product.id}}&t={{config.pType}}">查看详情</a>
                    <a href="javascript:;" ng-if="product.biddingStatus == 1 " ng-click="showHide(product.id,1)">审核</a>
                    <a href="javascript:;"  ng-if="product.biddingStatus == 3 " ng-click="showHide(product.id)">收回承销权</a>
                </td>
            </tr>
        </tbody>
    </table>
</div>
<div class="pager-box" ng-include src="'tpl/public/pager.html'" ng-show="list.length >0"></div>

<div class="layer-box" ng-show="showEstablishaFormFlag">
    <div class="layer-bg"></div>
    <div class="layer-con " style="padding:10px 20px;">
        <h1 style="font-size:30px; border-bottom: 1px solid #171515;">产品审核</h1>
        
        <form style="padding-top:20px;" class="form-horizontal" role="form" name="estagForm" novalidate ng-submit="changeStatus(param.biddingStatus)">
            <span class="icons-close" title="关闭" ng-click="showEstablishaFormFlag = false;">X</span>
            <div>
                <span  style="font-size: 16px;">
                    <input type="radio" name="status" ng-click="passUpdate(1);" ng-model='param.biddingStatus' value="3">通过</span>
               
                <span  style="font-size: 16px;padding-left:100px;">
                    <input type="radio" name="status" ng-click="passUpdate(2);" ng-model='param.biddingStatus' value="2">不通过</span>
            </div>
            <ul style="text-align: left; padding-top:15px;" ng-show="showFailResonInput">
                <li style="font-size: 18px;">不通过的原因</li>
                <li style="font-size: 15px;">
                    <input type="radio" name="failReson" ng-click="param.failReson='产品募集进度已结束'" />
                    产品募集进度已结束
                </li>
                <li style="font-size: 15px;">
                    <input type="radio" name="failReson" ng-click="param.failReson='竞价人无法提供佣金'" />
                    竞价人无法提供佣金
                </li>
                <li style="font-size: 15px;">
                    <input type="radio" name="failReson" ng-click="param.failReson='无产品承销能力'" />
                    无产品承销能力
                </li>
                <li style="font-size: 15px;">
                    <input type="radio" name="failReson" ng-click="param.failReson=''" />
                    其他,请输入失败原因:
                </li>
            </ul>
            <div ng-show="!showFailResonInput" style="height:50px;padding-top:15px;">
                
            </div>
            
            <div class="con-wrap">
                <div class="form-group" ng-class="{'has-error':estagForm.param.failReson.$invalid}" >
                    <textarea ng-show="showFailResonInput" style="width: 300px;height: 50px;" ng-model="param.failReson" required="required"></textarea>
                </div>
                <div class="form-group"  style="width: 300px;height: 100px;" >
                    <input type="submit" class="btn btn-block btn-primary" value="保存" />
                </div>
            </div>
        </form>
    </div>
</div>


<div class="layer-box" ng-show="showPublishFailFormFlag">
    <div class="layer-bg"></div>
    <div class="layer-con " style="padding:10px 20px;">
        <span>收回承销权利</span>
        <form class="form-horizontal" role="form" name="estagForm" novalidate ng-submit="changeStatus(6)">
            <span class="icons-close" title="关闭" ng-click="showPublishFailFormFlag = false;">X</span>
            <ul style="text-align: left;">
                <li>收回承销权原因</li>
                <li>
                    <input type="radio" name="failReson" ng-click="param.failReson='产品募集进度已结束'" />
                    用户放弃
                </li>
                <li>
                    <input type="radio" name="failReson" ng-click="param.failReson='竞价人无法提供佣金'" />
                    竞价人无法提供佣金
                </li>
                <li>
                    <input type="radio" name="failReson" ng-click="param.failReson='无产品承销能力'" />
                    无产品承销能力
                </li>
                <li>
                    <input type="radio" name="failReson" ng-click="param.failReson='其他'" />
                    其他(5-20字)
                </li>
            </ul>
            <div class="layer-title" >其他原因</div>
            <div class="con-wrap">
                <div class="form-group" ng-class="{'has-error':estagForm.param.failReson.$invalid}">
                    <textarea style="width: 300px;height: 100px;" ng-model="param.failReson" required="required"></textarea>
                </div>
                <div class="form-group" >
                    <input type="submit" class="btn btn-block btn-primary" value="保存" />
                </div>
            </div>
        </form>
    </div>
</div>